<?php
/**
 * 品牌管理模型
 * @author e5
 *
 */
class BrandModel extends Model{
	public $table = "brand";
	public $validate = array(
			array("bname","nonull","品牌名称不能为空",2,3),
			array("bname","maxlen:20","品牌名称不能超过20个字符",2,3),
			array("logo","nonull","品牌logo不能为空",2,3)
	);
	public $auto = array(
			array("bsort","intval","funciton",2,3),
			array("ishot","intval","funciton",2,3)
	);
	public $map = array(
			"logo"=>"blogo"
	);
	/**
	 * 添加品牌
	 */
	public function addBrand(){
		if (!$this->create()) return false;
		return $this->add();
	}
	/**
	 * 编辑品牌
	 */
	public function editBrand(){
		if (!$this->create()) return false;
		$this->update();
		return true;
	}
}
?>